UserType
Dealing With UserType
In order to deal with the User and the functionality related to User, we use the UserType interface:
interface UserType {
id?: number;
name?: string;
phone_number?: string;
email?: string;
date_of_birth?: string;
gender?: GenderType; // 'male' | 'female'
insurance_id?: string;
policy_number?: string;
nationality_number?: string;
avatar_media_id?: string;
height?: string;
weight?: string;
blood_type?: BloodType; // 'A+' | 'B+' | 'AB+' | 'O+' | 'A-' | 'B-' | 'AB-' | 'O-'
smoker?: BoolString; // 'yes' | 'no'
alcoholic?: BoolString; // 'yes' | 'no'
marital_status?: MaritalStatus; // 'single' | 'married' | 'divorced' | 'widow'
created_at?: string;
updated_at?: string;
relation_type?: RelationType; // 'personal' | 'father' | 'mother' | 'sister' | 'brother' | 'child' | 'husband' | 'wife' | 'other'
}
User Functionalities
The following are the functions related to user management:
| API | Params |
|---|---|
| createUser | userData: UserType |
| updateUser | user: UserType, user_id: string |
| getUser | user_id: string |
| getUsers | page: number, perPage: number |
| deleteUser | user_id: string |